package day6;

import java.util.Arrays;

/**
 * @author oldliu
 * @since 1.0
 */
public class Jiang {
    public static void main(String[] args) {
        int[] a = new int[6];
        int i;
        for (i = 0; i < 6; ) {
            int x;
            x = (int) (Math.random() * 33 + 1);
            //i,从开头到当前值-1，有没有重复
            int j;
            for (j = 0; j < i; j++) {
                if (a[j] == x) {
                    break;//有重复
                }
            }
            if (j == i) {
                a[i++] = x;
                //i++;
            }
        }
        Arrays.sort(a);
        System.out.print("红球：");
        for (int t : a) {
            System.out.print(t + " ");
        }
        System.out.print("蓝球：" + (int) (Math.random() * 16 + 1));
    }
}
